package com.zhiyou100.api.java8_date;

import java.time.LocalDateTime;
import java.time.ZoneId;

/**
 * 时区：ZoneId
 */
public class Demo5 {

    public static void main(String[] args) {
        //根据指定的时区获取时区对象  Asia/Shanghai   UTC  GMT
        ZoneId zoneId = ZoneId.of("Asia/Shanghai");
        //根据指定的时区获取日期
        LocalDateTime date = LocalDateTime.now(zoneId);
        System.out.println("date = " + date);
        //获取系统默认时区
        ZoneId zoneId1 = ZoneId.systemDefault();
        System.out.println("zoneId1 = " + zoneId1);
    }
}



